import 'package:flutter/src/services/message_codec.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:nordic_otas_plugin/nordic_otas_plugin.dart';
import 'package:nordic_otas_plugin/nordic_otas_plugin_platform_interface.dart';
import 'package:nordic_otas_plugin/nordic_otas_plugin_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockNordicOtasPluginPlatform
    with MockPlatformInterfaceMixin
    implements NordicOtasPluginPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  void setFilePath(String path) {
    // TODO: implement setFilePath
  }

  @override
  void startOta() {
    // TODO: implement startOta
  }

  @override
  void otaListener(Future Function(MethodCall call)? handler) {
    // TODO: implement otaListener
  }

  @override
  void startAndroidOta(String name, String address) {
    // TODO: implement startAndroidOta
  }

  @override
  Future<bool> notice() {
    // TODO: implement notice
    throw UnimplementedError();
  }

  
}

void main() {
  final NordicOtasPluginPlatform initialPlatform = NordicOtasPluginPlatform.instance;

  test('$MethodChannelNordicOtasPlugin is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelNordicOtasPlugin>());
  });

  test('getPlatformVersion', () async {
    NordicOtasPlugin nordicOtasPlugin = NordicOtasPlugin();
    MockNordicOtasPluginPlatform fakePlatform = MockNordicOtasPluginPlatform();
    NordicOtasPluginPlatform.instance = fakePlatform;

    expect(await nordicOtasPlugin.getPlatformVersion(), '42');
  });
}
